package com.yidu.best.systemManagement.resourceManagement.domain;

import java.io.Serializable;

public class Resource implements Serializable {
	/**
	 * 序列号
	 */
	private static final long serialVersionUID = -8180211184307414686L;

	/**
	 * 资源Id
	 */
	private String resourceId;

	/**
	 * 资源名
	 */
	/*
	 * @NotEmpty(message="资源名不能为空！！！")//非空
	 * 
	 * @Length(min=2,max=18,message="资源名长度必须在6~18位！！！")
	 */
	private String resourceName;

	/**
	 * 缩写
	 */
	private String shortName;

	/**
	 * 父资源Id
	 */
	private String parentId;

	/**
	 * 父资源名
	 */
	/*
	 * @NotEmpty(message="父资源名不能为空")//非空
	 */ private String parentName;

	/**
	 * 资源Url
	 */
	private String resourceUrl;

	/**
	 * 资源类型
	 */
	private String resourceType;

	/**
	 * 资源级别
	 */
	private String resourceRank;

	/**
	 * 资源序号
	 */
	private Integer resourceNumber;

	/**
	 * 是否可用 0--不可用 1--可用
	 */
	/* @Range(min=0,max=1,message="可用为‘1’，不可用为‘0’") */
	private Integer usable;

	/**
	 * 描述
	 */
	/*
	 * @NotEmpty(message="描述不能为空")//非空
	 * 
	 * @Length(min=4,max=18,message="描述长度必须在6~18位！！！")
	 */
	private String remark;

	public Resource() {
		super();
	}

	public Resource(String parentName) {
		super();
		this.parentName = parentName;
	}

	public Resource(String resourceId, String resourceName, String shortName, String parentId, String parentName,
			String resourceUrl, String resourceType, String resourceRank, Integer resourceNumber, Integer usable,
			String remark) {
		super();
		this.resourceId = resourceId;
		this.resourceName = resourceName;
		this.shortName = shortName;
		this.parentId = parentId;
		this.parentName = parentName;
		this.resourceUrl = resourceUrl;
		this.resourceType = resourceType;
		this.resourceRank = resourceRank;
		this.resourceNumber = resourceNumber;
		this.usable = usable;
		this.remark = remark;
	}

	public String getResourceId() {
		return resourceId;
	}

	public void setResourceId(String resourceId) {
		this.resourceId = resourceId;
	}

	public String getResourceName() {
		return resourceName;
	}

	public void setResourceName(String resourceName) {
		this.resourceName = resourceName;
	}

	public String getShortName() {
		return shortName;
	}

	public void setShortName(String shortName) {
		this.shortName = shortName;
	}

	public String getParentId() {
		return parentId;
	}

	public void setParentId(String parentId) {
		this.parentId = parentId;
	}

	public String getParentName() {
		return parentName;
	}

	public void setParentName(String parentName) {
		this.parentName = parentName;
	}

	public String getResourceUrl() {
		return resourceUrl;
	}

	public void setResourceUrl(String resourceUrl) {
		this.resourceUrl = resourceUrl;
	}

	public String getResourceType() {
		return resourceType;
	}

	public void setResourceType(String resourceType) {
		this.resourceType = resourceType;
	}

	public String getResourceRank() {
		return resourceRank;
	}

	public void setResourceRank(String resourceRank) {
		this.resourceRank = resourceRank;
	}

	public Integer getResourceNumber() {
		return resourceNumber;
	}

	public void setResourceNumber(Integer resourceNumber) {
		this.resourceNumber = resourceNumber;
	}

	public Integer getUsable() {
		return usable;
	}

	public void setUsable(Integer usable) {
		this.usable = usable;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((parentId == null) ? 0 : parentId.hashCode());
		result = prime * result + ((parentName == null) ? 0 : parentName.hashCode());
		result = prime * result + ((remark == null) ? 0 : remark.hashCode());
		result = prime * result + ((resourceId == null) ? 0 : resourceId.hashCode());
		result = prime * result + ((resourceName == null) ? 0 : resourceName.hashCode());
		result = prime * result + ((resourceNumber == null) ? 0 : resourceNumber.hashCode());
		result = prime * result + ((resourceRank == null) ? 0 : resourceRank.hashCode());
		result = prime * result + ((resourceType == null) ? 0 : resourceType.hashCode());
		result = prime * result + ((resourceUrl == null) ? 0 : resourceUrl.hashCode());
		result = prime * result + ((shortName == null) ? 0 : shortName.hashCode());
		result = prime * result + ((usable == null) ? 0 : usable.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Resource other = (Resource) obj;
		if (parentId == null) {
			if (other.parentId != null)
				return false;
		} else if (!parentId.equals(other.parentId))
			return false;
		if (parentName == null) {
			if (other.parentName != null)
				return false;
		} else if (!parentName.equals(other.parentName))
			return false;
		if (remark == null) {
			if (other.remark != null)
				return false;
		} else if (!remark.equals(other.remark))
			return false;
		if (resourceId == null) {
			if (other.resourceId != null)
				return false;
		} else if (!resourceId.equals(other.resourceId))
			return false;
		if (resourceName == null) {
			if (other.resourceName != null)
				return false;
		} else if (!resourceName.equals(other.resourceName))
			return false;
		if (resourceNumber == null) {
			if (other.resourceNumber != null)
				return false;
		} else if (!resourceNumber.equals(other.resourceNumber))
			return false;
		if (resourceRank == null) {
			if (other.resourceRank != null)
				return false;
		} else if (!resourceRank.equals(other.resourceRank))
			return false;
		if (resourceType == null) {
			if (other.resourceType != null)
				return false;
		} else if (!resourceType.equals(other.resourceType))
			return false;
		if (resourceUrl == null) {
			if (other.resourceUrl != null)
				return false;
		} else if (!resourceUrl.equals(other.resourceUrl))
			return false;
		if (shortName == null) {
			if (other.shortName != null)
				return false;
		} else if (!shortName.equals(other.shortName))
			return false;
		if (usable == null) {
			if (other.usable != null)
				return false;
		} else if (!usable.equals(other.usable))
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "Resources [resourceId=" + resourceId + ", resourceName=" + resourceName + ", shortName=" + shortName
				+ ", parentId=" + parentId + ", parentName=" + parentName + ", resourceUrl=" + resourceUrl
				+ ", resourceType=" + resourceType + ", resourceRank=" + resourceRank + ", resourceNumber="
				+ resourceNumber + ", usable=" + usable + ", remark=" + remark + "]";
	}

}
